#!/user/bin/env python3
# -*- coding: utf-8 -*-
"""
--------------------------------------
    Author:     JiChao_Song
    Date  :     2022/1/26 13:26
    Desc  :
--------------------------------------
"""
import httpx


def upload_file(file):
    """
    文件上传(无鉴权)
    :return:
    """
    url = 'http://preuploadv2.viphrm.com/filemanager/upload'
    files = {
        'file': file
    }
    headers = {
        'Mscid': '288572'
    }
    res = httpx.post(url = url, files = files, headers = headers).json()

    if res.get('result') != 0:
        return False, res.get('detail')
    else:
        return True, res.get('data')
